|
RtndUpDown is called when the stack requires that the driver start (or stop) a particular NIC card.
Given a flag value of non-zero RtndUpDown will bring up the NIC. An interrupt should be attached to a vector and enabled from the card; DMA should be turned on, etc. The driver should also initialize it's receive packet pool by calling the RtnAllocRecvBuffers function.
Given a flag value of zero RtndUpDown will bring down the NIC card. All interrupts should be disabled from the card and interrupt vector should be released. DMA should be turned off, and the card should be placed in a safe dormant state. Event handles should be closed, the Receive thread and possibly the Transmit thread should be terminated, etc.
The driver should also free its receive packet pool by calling the RtnFreeRecvBuffers function.
See RtTemplateFuncs.c and the driver source files in the RT-TCP/IP SDK for more details on the implementation of RtndUpDown.
Syntax
int RtndUpDown( void *ndp, unsigned short flags, char *options );
Parameters
ndp
Network Device Pointer. Opaque network device identifier.
flags
Flag indicating if the network device is being started or stopped.
options
Reserved.
Return Values
A return value of 0 indicates Success, -1 indicates Failure.
Process Context
RtndUpDown is always called from within the process context of the RtxTcpIp Protocol Stack.